/*
 * @Author: your name
 * @Date: 2020-04-16 09:49:06
 * @LastEditTime: 2020-05-21 14:46:00
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \v1.0.0\pages\work\interface.js
 */
import { http,navigate } from '@/common/framework'

import config from '@/common/config';




/************************api*******************************/

/**
 *获取组织机构树，包括人员
 *
 * @export
 * @param {*} params
 * @returns
 */
export function queryAddressBook(params) {
    return http.post(config.webApiUrl + '/kmlc/sys/sysDepart/queryAppUserAndDepartTree', params)
}

/**
 *获取组织机构树，不不不包括人员
 *
 * @export
 * @param {*} params
 * @returns
 */
export function queryDepartTree(params) {
    return http.post(config.webApiUrl + '/kmlc/sys/sysDepart/queryAppTreeList', params)
}

export const uploadFileUrl = config.webApiUrl +'/kmlc/sys/common/upload';


//跳转到审批详情
export function goDetailPage(msgId,type) {
	// 采购流程：purchaseEnter
	// 领用流程：approval
	// 出库流程：output
	// 入库流程：enter
	let url='/pages/work/building/building';
	let [procInsId,businessKey] = msgId &&msgId.indexOf(',')>-1&&msgId.split(',');
	if(type){
		switch(type){
			case 'purchaseEnter':
				url = `/pages/work/approval_detail/approval_detail?procInsId=${procInsId}&businessKey=${businessKey}`;
			break;
			case 'approval':
				url = `/pages/work/approval_receive_detail/approval_receive_detail?procInsId=${procInsId}&businessKey=${businessKey}`;
			break;
			case 'output':
				// url = `/pages/work/approval_detail/approval_detail?procInsId=${procInsId}&businessKey=${businessKey}`;
			break;
			case 'enter':
				// url = `/pages/work/approval_detail/approval_detail?procInsId=${procInsId}&businessKey=${businessKey}`;
			break;
			default:break;
		}
	}
	
	url &&navigate.gotoPage(url);
  }

  
